<template>
	<view class="content">
		<view class="detail-count">
			<view class="block tab-block">
				<view class="block list-block">
					<template v-if="list.length>0">
						<view @click="navigate('/page_other/company/company?id='+item.ent.id)" class="list-item"
							v-for="(item,index) in list" :key="item.id">
							<image
								:src="item.ent.logoUrl ? item.ent.logoUrl : imageUrl+'/job_hunting/job_detail/enterprise.jpg'"
								class="cover-photo"></image>
							<view class="list-info">
								<view class="title">{{item.ent.brandName}}</view>
								<view class="address">
									<view class="add" v-if="item.ent.enterpriseTypeText">
										{{item.ent.enterpriseTypeText}}
									</view>
									<view class="add" v-else style="margin-left: 0px;">暂无企业类型</view>
									<view class="add"> / {{item.ent.scaleName}}</view>
								</view>
							</view>
						</view>
					</template>
					<view v-else-if="list.length>0&&!more" style="text-align: center;">没有更多了哦</view>
					<view v-else style="text-align: center;">暂无数据</view>
				</view>
			</view>
		</view>

	</view>
	</view>
</template>

<script>
	import {
		getLookMeFindByCidList
	} from '@/api/count_details.js';
	import {
		getStorage
	} from '@/util/auth.js';
	import util from '@/util/util.js'
	import {
		isMore
	} from '@/util/util.js'
	export default {
		data() {
			return {
				imageUrl: '',
				list: [],
				page: 1,
				limit: 10,
				more: true,
				total: 0,
			}
		},
		methods: {
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			refresh() {
				this.page = 1
				this.more = true
				this.getList(true);
			},
			async getList(refresh = false) {
				if (this.more) {
					let config = {
						userType: 1,
						lookMeType: 2,
						page: this.page,
						limit: this.limit
					}
					uni.showLoading({
						title: '加载中',
						mask: true
					})
					let res = await getLookMeFindByCidList(config)
					let list = res.list ?? [];
					this.list = refresh ? list : [...this.list, ...list],
						this.total = res.count
					this.more = isMore(this.page, this.limit, this.total)
				}
			}
		},
		onLoad(e) {
			this.imageUrl = this.globalConfig.imageUrl;
			this.getList(true);
		},
		onPullDownRefresh() {
			this.refresh();
			uni.stopPullDownRefresh();
		},
		onReachBottom() {
			if (this.more) {
				this.page++;
				this.getList()
			}
		},
	}
</script>

<style lang="scss">
	.content {
		width: 100%;
		padding: 0 30rpx;

		.btn {
			width: 50%;
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 80rpx;
			text-align: center;
			color: #fff;
			//background-color: #ff7626;
			font-size: 32rpx;
			font-weight: bold;
			position: fixed;
			bottom: 30rpx;
			left: calc(50% / 2);
			right: calc(50% / 2);
			border-left: 5px solid transparent;
			border-right: 5px solid transparent;
			//margin: 655px 72px;
		}

		.block.tab-block {
			box-shadow: none;
			display: flex;
			flex-direction: row;
			justify-content: left;
			flex-wrap: wrap;
			width: 100%;

			.article-content {
				font-size: 27rpx;
				line-height: 50rpx;
				margin-top: 30rpx;
			}

			.list-block.block {
				margin-top: 30rpx;
				width: 100%;
				display: flex;
				flex-direction: column;

				.company-item {
					.company-name {
						display: flex;
						align-items: center;
						justify-content: space-between;
						padding: 30rpx 0 20rpx 0;

						.name-block {
							display: flex;
							align-items: center;
							font-weight: bold;

							.line {
								width: 15rpx;
								height: 35rpx;
								border-radius: 16rpx;
								background-color: #FE7526;
								margin-right: 10rpx;
							}
						}

						.more {
							color: #999;
							font-size: 30rpx;
						}
					}
				}

				.list-item {
					width: 100%;
					background: #FAFAFA;
					border-radius: 10rpx;
					box-shadow: 0 0 10px 0 #efefef;
					padding: 20rpx;
					display: flex;
					flex-direction: row;
					justify-content: center;
					margin: 20rpx auto;

					.cover-photo {
						width: 25%;
						height: 150rpx;
						background: #efefef;
						margin-right: 20rpx;
						border-radius: 20rpx;

					}

					.list-info {
						width: 70%;
						display: flex;
						flex-direction: column;

						view {
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}

						.title {
							color: #000;
							font-weight: bold;
							font-size: 34rpx;
						}

						.address {
							display: flex;
							flex-direction: row;

							.add {
								color: #999;
								font-size: 26rpx;
								margin-top: 30rpx;
							}
						}

						.city {
							color: #999;
							font-size: 26rpx;
							margin-left: 4rpx;
						}

						.imgs2 {
							width: 17px;
							height: 17px;
							margin-left: 70rpx;
							vertical-align: bottom;
						}

						.positionCount {
							font-size: 28rpx;
							margin-top: 30rpx;
						}

						.label-block {
							font-size: 24rpx;
							display: flex;
							flex-direction: row;
							flex-wrap: wrap;
							justify-content: left;
							margin-top: 20rpx;

							.label-item {
								padding: 8rpx 20rpx;
								background: #F5F6F8;
								color: #999;
								margin: 0 10rpx 20rpx 0;
							}
						}

						.wage {
							color: #FE7526;
							font-size: 36rpx;
							font-weight: bold;

							.unit {
								font-size: 28rpx;
								font-weight: normal;
							}
						}
					}
				}

				.list-item.policy-item {
					height: 220rpx;
					width: 100%;
					padding: 30rpx 0;
					display: flex;
					flex-direction: row;
					border-radius: 20rpx;
					background: #fff;
					margin-bottom: 30rpx;
					padding: 20rpx;
					box-shadow: 0 0 10px 0 #efefef;

					.cover-photo {
						width: 180rpx;
						height: 180rpx;
						border-radius: 10rpx;
						margin-right: 20rpx;
						background: #efefef;
					}

					.info {
						width: calc(100% - 200rpx);
						height: 100%;

						.title {
							font-weight: bold;
						}

						.abstract {
							font-size: 24rpx;
							color: #999;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							-webkit-line-clamp: 2;
							overflow: hidden;
							margin-top: 10rpx;
							line-height: 1.5;
						}

						.time {
							margin-top: 10rpx;
							font-size: 28rpx;
							color: #999;
						}
					}
				}

				.detail-block {
					width: 100%;
					padding: 30rpx;
					margin: auto auto 30rpx auto;
					background-color: #fff;

					.title {
						font-size: 34rpx;
						font-weight: bold;
						margin-bottom: 30rpx;
					}

					.sub-title {
						font-size: 28rpx;
						color: #999;
						margin-bottom: 30rpx;
					}

					.article-content {
						font-size: 30rpx;
						line-height: 60rpx;
					}
				}

				.apply-btn {
					width: 50%;
					height: 70rpx;
					line-height: 70rpx;
					background-color: #ff7626;
					color: #fff;
					text-align: center;
					border-radius: 100rpx;
					margin: 40rpx auto;
				}
			}

			.tab-item {
				padding: 10rpx 15rpx;
				font-weight: bold;
				font-size: 30rpx;
				margin-right: 30rpx;
			}

			.tab-item.active {
				background: url("https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/job_hunting/home/tab_selected_bg.png") no-repeat right bottom;
				background-size: 45%;
				font-size: 32rpx;
			}
		}

		.detail-block {
			width: 100%;
			padding: 30rpx;
			margin: auto auto 30rpx auto;
			background-color: #fff;
			border-radius: 20rpx;

			.time {
				margin-top: 10rpx;
				font-size: 25rpx;

			}

			.title {
				font-size: 34rpx;
				font-weight: bold;
				margin-bottom: 30rpx;
				border-bottom: 1px solid #efefef;
				height: 120rpx;
				padding-top: 32rpx;
			}

			.sub-title {
				font-size: 25rpx;
				color: #999;
				margin-bottom: 30rpx;
				padding-left: 10rpx;
				align-items: center;

			}

			.imgs {
				width: 30rpx;
				height: 30rpx;
				vertical-align: middle;
			}

		}

		.detail-count {
			width: 100%;
			padding: 30rpx;
			margin: auto auto 30rpx auto;
			background-color: #fff;
			border-radius: 20rpx;
			display: flex;

			.label-title {
				width: 180rpx;
				border-right: 1px solid #efefef;
				font-size: 26rpx;
			}

			.label-title2 {
				width: 180rpx;
				border-right: 1px solid #efefef;
				font-size: 26rpx;
				text-align: center;

			}

			.label-titlenoBorder {
				width: 180rpx;
				font-size: 26rpx;
				margin-left: 20rpx;
				text-align: center;
			}

			.count {
				color: #ff7626;
				font-size: 32rpx;
				font-weight: bold;

			}
		}



	}
</style>
